<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/6
 * Time: 14:54
 */

namespace App\Http\Controllers;


use App\Http\BaseController;
use App\Services\SendSms;
use Illuminate\Http\Request;

class CommonController extends BaseController
{

    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    //获取短信验证码
    public function getCode()
    {
        $phone = $this->request->input('phone');
        $result = SendSms::sendMessage($phone);
        return $this->json_success('短信获取成功！');
    }

    public function testRedis()
    {
        $code = $this->request->input('code');
        $phone = $this->request->input('phone');
        SendSms::checkCode($phone,$code);
    }
    
}